Skip to content

drivers: media: rpi: cfe: Avoid unpack operation for 16-bit formats#6926

Merged
naushir merged 1 commit intoraspberrypi:rpi-6.12.yfrom
naushir:rpi-6.12.y
Jun 27, 2025
Merged

drivers: media: rpi: cfe: Avoid unpack operation for 16-bit formats#6926
naushir merged 1 commit intoraspberrypi:rpi-6.12.yfrom
naushir:rpi-6.12.y

Conversation

@naushir
Copy link
Copy Markdown
Contributor

@naushir naushir commented Jun 26, 2025

The unpack operation is redundant for 16-bit sensor formats, don't set the hardware to do it in these cases.


if (node->vid_fmt.fmt.pix.pixelformat ==
/* We don't need to repack in the case of 16-bit output. */
if (fmt.depth != 16 &&
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fmt->depth

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Groan, I even had that locally!

The unpack operation is redundant for 16-bit sensor formats, don't set
the hardware to do it in these cases.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
@naushir
Copy link
Copy Markdown
Contributor Author

naushir commented Jun 27, 2025

@njhollinghurst sadly I think this fix is only partially complete. We only remove the REMAP mode for direct CSI-2 output, not the FE output.

From reading the spec, if mode == 2’b11 (route to FE), then REMAP happens unconditionally. This means we cannot apply a similar bit of logic to remove the REMAP 😢

@njhollinghurst
Copy link
Copy Markdown
Contributor

Yes, the only workaround when using FE is to use the 'wildcard' DT (which is equivalent to reverting 98b1f0d) with the side-effect that it will then capture metadata and other DTs.

FE could in theory crop out the different components, but better to avoid FE altogether if we can.

@naushir
Copy link
Copy Markdown
Contributor Author

naushir commented Jun 27, 2025

Merging this now as it's correct, but fixing the core issue still needs quite a bit of additional work.

@naushir naushir merged commit 274049e into raspberrypi:rpi-6.12.y Jun 27, 2025
12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jun 30, 2025
kernel: drivers: media: rpi: cfe: Avoid unpack operation for 16-bit formats
See: raspberrypi/linux#6926
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Jun 30, 2025
kernel: drivers: media: rpi: cfe: Avoid unpack operation for 16-bit formats
See: raspberrypi/linux#6926
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants